package com.trace.action;

import java.io.IOException;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

public class UserAction {
	
	public void login(HttpServletRequest request,
			HttpServletResponse response) throws ServletException, IOException {

		String userId = request.getParameter("userId");
		System.out.println("userId:"+userId);
		if (userId != null && !userId.trim().equals("")) {
			request.getSession().setAttribute("userLoginId", userId);
			request.getRequestDispatcher("/index.jsp").forward(
					request, response);
		} else {
			request.setAttribute("errorMessage", "user id is null;");
			request.getRequestDispatcher("/Message/showMessage").forward(
					request, response);
			
		}

	}

}
